function main()
    local co1 = {}
    local co2 = {}
    local co3 = {}
    co4 = {}
    colist[1] = co1
    colist[2] = co2
    colist[3] = co3
    colist[4] = co4
    
    print("before free")
    showtable()
    collectgarbage()
    print("after free")
    showtable()

    co2 = nil
    collectgarbage()
    print("after co2 = nil")
    showtable()
end

function showtable()
    for k,v in pairs(colist)
    do
        print(k, v)
    end
    print()
end

colist = {}
setmetatable(colist, {__mode="v"})
main()
collectgarbage()
print("out of main")
showtable()


